package com.mh.common.core.page;

import java.io.Serializable;
import java.util.List;

//分页数据统一封装响应对象
public class PageResult implements Serializable {

    private static final long serialVersionUID = 4852200853620715201L;

    //总记录数(查询结果)
    private long total;
    //列表数据(查询结果)
    private List<?> rows;
    //消息状态码
    private Integer code;
    //消息内容
    private String msg;

    //空参
    public PageResult() {
    }
    //2个参数构造,分页相关数据(总记录数,列表数据)
    public PageResult(long total, List<?> rows) {
        this.total = total;
        this.rows = rows;
    }
    //全参
    public PageResult(long total, List<?> rows, Integer code, String msg) {
        this.total = total;
        this.rows = rows;
        this.code = code;
        this.msg = msg;
    }
    //set(),get()
    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<?> getRows() {
        return rows;
    }

    public void setRows(List<?> rows) {
        this.rows = rows;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
